package com.du.integration.server.config;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Desc :
 * @Author: shuangdu
 * @date : 2024/1/8
 */
@ConditionalOnProperty(prefix = "mqtt", name = "enable", havingValue = "true")
@Configuration
public class MqttConfig {

    @Bean(name = "customMqttClient")
    public CustomMqttClient customMqttClient(@Qualifier(value = "mqttOption") MqttOption mqttOption) {
        CustomMqttClient client = new CustomMqttClient(mqttOption);
        return client;
    }

}
